package com.shlh.saas.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shlh.saas.entity.VipPackage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

/**
 * VIP套餐Mapper接口
 */
@Mapper
public interface VipPackageMapper extends BaseMapper<VipPackage> {
    
    /**
     * 查询所有有效的VIP套餐列表
     * @return 套餐列表
     */
    @Select("SELECT id, level, name, price, description, duration, export_quota as exportQuota, view_records as viewRecords, reverse_lookup as reverseLookup, created_at as createdAt, updated_at as updatedAt, is_deleted as isDeleted FROM vip_packages WHERE is_deleted = 0 ORDER BY level ASC")
    List<VipPackage> selectAllValidPackages();
    
    /**
     * 简单测试数据库连接
     * @return 数量
     */
    @Select("SELECT COUNT(*) FROM vip_packages")
    int countPackages();
} 